<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h1>

        You fool
    </h1>
</body>
<script>



    function test() {
        console.log(1) //同
        setTimeout(function () { // timer1
            console.log(2)
        }, 1000)
    }
    test();

    setTimeout(function () { // timer2
        console.log(3)
    })
    new Promise(function (resolve) {
        console.log(4)//同
        setTimeout(function () { // timer3
            console.log(5)
        }, 100)
        resolve()
    }).then(function () {
        setTimeout(function () { // timer4
            console.log(6)
        }, 0)
        console.log(7)
    })
    console.log(8)/同


    // 1 4 8 7 3 6  5 2
</script>

</html>